The bug found in the presentation that we forgot to review has been fixed
[RRRRHHHH_Code] / ruralHouses client / src / gui / ModifyOfferGUI.java
index 3e7a6c6..83bb656 100644 (file)
@@ -151,7 +151,6 @@ public class ModifyOfferGUI extends JFrame {
                                try {
                                        vo = om.getRuralHouseOffers((RuralHouse) jComboBox1.getSelectedItem());
                                } catch (RemoteException e) {
-                                       // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }
                                comboBox_o.removeAllItems();
@@ -253,7 +252,28 @@ public class ModifyOfferGUI extends JFrame {
                                }
                        }
                });
-
+               if(((Offer) comboBox_o.getSelectedItem()).isBooked()){
+                       jLabel5.setText("This offer is already booked.");
+                       jButton1.setEnabled(false);                                     
+               }
+               comboBox_o.addItemListener(new ItemListener() {
+                       @Override
+                       public void itemStateChanged(ItemEvent arg0) {
+                               if(((Offer) comboBox_o.getSelectedItem()).isBooked()){
+                                       jLabel5.setText("This offer is already booked.");
+                                       jButton1.setEnabled(false);                                     
+                               }
+                       }
+               });
+               comboBox_o.addItemListener(new ItemListener() {
+                       @Override
+                       public void itemStateChanged(ItemEvent arg0) {
+                               if(!((Offer) comboBox_o.getSelectedItem()).isBooked()){
+                                       jLabel5.setText("");;
+                                       jButton1.setEnabled(true);                                      
+                               }
+                       }
+               });
                this.getContentPane().add(jCalendar2, null);
                this.getContentPane().add(jCalendar1, null);
                this.getContentPane().add(jLabel5, null);